#ifndef _CROSSENGINE_CROSSOBJECT_H_
#define _CROSSENGINE_CROSSOBJECT_H_
#include "common.h"
#include "memalloc.h"

class CrossEvent;
class DelayCrossEvent;

class CrossObject
{
    ClassNoneCopyable(CrossObject)
public:
    virtual ~CrossObject();
    CrossObject();
    uint64 Code(){return _objCode;}
    virtual void DeleteThis();
    void PostEvent(CrossEvent* e);
    void PostDelayEvent(DelayCrossEvent* e,uint32 deltaTick,bool forever);
    static uint64 GetCurrentCode(){return CurrentCode;}
private:
    uint64 _objCode;

    static uint64 CurrentCode;
};

#endif//_CROSSENGINE_CROSSOBJECT_H_
